package design_patterns;

public class NewsServiceImpl implements NewsService{
    //把实例化所依赖的NewsDao对象
//    private NewDao dao=new NewsDaoImpl();
    @Override
    public void addNews(News news) {
        //调用NewsDao的方法保存新闻信息
        dao.save(news);
    }
    private NewDao dao;
    public void setDao(NewDao dao){
        this.dao=dao;
    }

}
